Optimal. Leaf size=326 \[ \frac {(1-n) (3-n) \left (1-4 n+n^2\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+n)}+\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))}+\frac {i (2-n)^2 (4-n) n \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{48 a^4 d^2 f (2+n)}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.66, antiderivative size = 326, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3640, 3677,
3619, 3557, 371} \begin {gather*} \frac {i (2-n)^2 (4-n) n (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac {n+2}{2};\frac {n+4}{2};-\tan ^2(e+f x)\right )}{48 a^4 d^2 f (n+2)}+\frac {(1-n) (3-n) \left (n^2-4 n+1\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};-\tan ^2(e+f x)\right )}{48 a^4 d f (n+1)}+\frac {\left (n^2-7 n+13\right ) (d \tan (e+f x))^{n+1}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{n+1}}{48 a^4 d f (1+i \tan (e+f x))}+\frac {(5-n) (d \tan (e+f x))^{n+1}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {(d \tan (e+f x))^{n+1}}{8 d f (a+i a \tan (e+f x))^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 371
Rule 3557
Rule 3619
Rule 3640
Rule 3677
Rubi steps
\begin {align*} \int \frac {(d \tan (e+f x))^n}{(a+i a \tan (e+f x))^4} \, dx &=\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {\int \frac {(d \tan (e+f x))^n (a d (7-n)-i a d (3-n) \tan (e+f x))}{(a+i a \tan (e+f x))^3} \, dx}{8 a^2 d}\\ &=\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {\int \frac {(d \tan (e+f x))^n \left (2 a^2 d^2 \left (16-7 n+n^2\right )-2 i a^2 d^2 (2-n) (5-n) \tan (e+f x)\right )}{(a+i a \tan (e+f x))^2} \, dx}{48 a^4 d^2}\\ &=\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {\int \frac {(d \tan (e+f x))^n \left (4 a^3 d^3 \left (19-20 n+8 n^2-n^3\right )-4 i a^3 d^3 (1-n) \left (13-7 n+n^2\right ) \tan (e+f x)\right )}{a+i a \tan (e+f x)} \, dx}{192 a^6 d^3}\\ &=\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{1+n}}{48 d f \left (a^4+i a^4 \tan (e+f x)\right )}+\frac {\int (d \tan (e+f x))^n \left (8 a^4 d^4 (1-n) (3-n) \left (1-4 n+n^2\right )+8 i a^4 d^4 (2-n)^2 (4-n) n \tan (e+f x)\right ) \, dx}{384 a^8 d^4}\\ &=\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{1+n}}{48 d f \left (a^4+i a^4 \tan (e+f x)\right )}+\frac {\left (i (2-n)^2 (4-n) n\right ) \int (d \tan (e+f x))^{1+n} \, dx}{48 a^4 d}+\frac {\left ((1-n) (3-n) \left (1-4 n+n^2\right )\right ) \int (d \tan (e+f x))^n \, dx}{48 a^4}\\ &=\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{1+n}}{48 d f \left (a^4+i a^4 \tan (e+f x)\right )}+\frac {\left (i (2-n)^2 (4-n) n\right ) \text {Subst}\left (\int \frac {x^{1+n}}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{48 a^4 f}+\frac {\left (d (1-n) (3-n) \left (1-4 n+n^2\right )\right ) \text {Subst}\left (\int \frac {x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{48 a^4 f}\\ &=\frac {(1-n) (3-n) \left (1-4 n+n^2\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+n)}+\frac {\left (13-7 n+n^2\right ) (d \tan (e+f x))^{1+n}}{48 a^4 d f (1+i \tan (e+f x))^2}+\frac {i (2-n)^2 (4-n) n \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{48 a^4 d^2 f (2+n)}+\frac {(d \tan (e+f x))^{1+n}}{8 d f (a+i a \tan (e+f x))^4}+\frac {(5-n) (d \tan (e+f x))^{1+n}}{24 a d f (a+i a \tan (e+f x))^3}+\frac {(2-n)^2 (4-n) (d \tan (e+f x))^{1+n}}{48 d f \left (a^4+i a^4 \tan (e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F]
time = 22.75, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(d \tan (e+f x))^n}{(a+i a \tan (e+f x))^4} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 1.43, size = 0, normalized size = 0.00 \[\int \frac {\left (d \tan \left (f x +e \right )\right )^{n}}{\left (a +i a \tan \left (f x +e \right )\right )^{4}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\left (d \tan {\left (e + f x \right )}\right )^{n}}{\tan ^{4}{\left (e + f x \right )} - 4 i \tan ^{3}{\left (e + f x \right )} - 6 \tan ^{2}{\left (e + f x \right )} + 4 i \tan {\left (e + f x \right )} + 1}\, dx}{a^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^4} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________